<template>
    <div class="page-doctor-list">
      <div class="p-x-15">
        <div class="p-t-15"></div>
        <div class="list fly-card">
          <div class="card-block" v-for="(item,index) in list" :key="index" @click="gotoNext(item)">
            <div class="item">
              <div class="thumb">
                <van-image :src="$util.baseUrl + item.staffPicture" round width="40px" height="40px" />
              </div>
              <div class="content">
                <div class="title"><b>{{item.staffName}}</b> <span>{{$util.setName(item.professionalTitle, init_data.professional_list)}}</span></div>
                <div class="desc">{{ item.officeName }}</div>
                <div class="desc ellipsis-2">{{ item.staffIntro }}</div>
              </div>
            </div>          
          </div>
        </div>
      </div>
    </div>
  </template>
  
  <script>
  import moment from 'moment';
  export default {
    data(){
      return{
        pageParams:{},
        list:[],
        init_data:{},
      }
    },
    async created(){
      this.pageParams = this.$route.query;
      await this.getInitData();
      this.getList();
    },
    methods:{
      async getInitData(){
        this.init_data.professional_list = await this.$util.getDictList('professional_title');
        this.init_data.staffLabel_list = await this.$util.getDictList('staff_label');
      },
      getList(){
        this.$http('get', '/admin/officeApi/getStaffList', {}, (data,msg) => {
            this.list = data;
        })
      },
      gotoNext(item){
        let params = Object.assign(this.$route.query, {makeStaffId: item.staffId, makeStaffName: item.staffName, officeId: item.officeId, officeName: item.officeName});
        this.$util.gotoPage('/doctor/index', params);
      }
    }
  }
  </script>
  
  <style>
  
  </style>